<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>

    <style>
      .box {
        display: flex;
        width: 23rem;
        border: 5px solid black;
      }
      .test {
        width: 10rem;
        height: 10rem;
        background-color: red;
      }
      .one {
        flex: 0 1 101rem;
      }
      .two {
        /* flex: 3; */
        background-color: green;
      }
    </style>
  </head>
  <body>
    <!-- <div class="box">
      <div class="one test"></div>
      <div class="two test"></div>
    </div> -->
    <div id="root"></div>
    <script
      crossorigin
      src="https://unpkg.com/react@17/umd/react.development.js"
    ></script>
    <script
      crossorigin
      src="https://unpkg.com/react-dom@17/umd/react-dom.development.js"
    ></script>
    <script src="https://unpkg.com/babel-standalone@6/babel.min.js"></script>

    <script type="text/babel">
      function Container() {
        return <div>你哈啊</div>;
      }

      const element = (
        <h1>
          <Container />
          <App />
        </h1>
      );

      function App() {
        const [initMap, setInitMap] = React.useState([1, 2, 3, 4]);
        const handleClick = () => {
          setInitMap([1, 2, 3, 4]);
          var spanEle = document.getElementsByTagName("span");
          Array.from(spanEle).map((it) => (it.style.color = "red"));
        };

        return (
          <div className="App" id="app">
            {initMap.map((it, index) => (
              <div key={index}>
                <input type="radio" />
              </div>
            ))}
            <button onClick={() => handleClick()}>点击</button>
          </div>
        );
      }

      ReactDOM.render(element, document.getElementById("root"));
    </script>
  </body>
</html>
